<template>
  <base-dialog v-bind="$attrs" v-on="$listeners" :title="title" size="tiny" @submit="toAdd" :disabled="disabled">
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px" :disabled="disabled">
      <el-form-item label="字典名称" prop="name">
        <el-input v-model="formData.name" placeholder="请输入字典名称"/>
      </el-form-item>
      <el-form-item label="字典编号" prop="value">
        <el-input v-model="formData.value" placeholder="请输入字典编号"/>
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <dict-radio v-model="formData.status" distKey="button_status_bool"></dict-radio>
      </el-form-item>
      <el-form-item label="排序">
        <el-input-number v-model="formData.no_order"></el-input-number>
      </el-form-item>
      <el-form-item label="备注">
        <el-input v-model="formData.remark" type="textarea"></el-input>
      </el-form-item>
    </el-form>
  </base-dialog>
</template>
<script>
  import BaseDialog from '@/components/Common/BaseDialog'
  import DetailDialog from '@/mixins/DetailDialog'
  import DeptSelectTree from '@/components/Common/DeptSelectTree'
  import SimpleSelect from '@/components/Common/SimpleSelect'
  import GenderFormItem from '@/components/FormItem/GenderFormItem'
  import DictRadio from '../../../components/DictRadio/index'

  export default {
    mixins: [DetailDialog],
    components: { DictRadio, GenderFormItem, SimpleSelect, DeptSelectTree, BaseDialog },
    data() {
      return {
        formData: {
          name: undefined,
          value: undefined,
          status:true,
          no_order: 1,
          remark:""
        },
        rules: {
          name: {
            required: true,
            message: '请输入字典名称',
            trigger: 'blur'
          },
          value: {
            required: true,
            message: '请输入字典类型',
            trigger: 'blur'
          }
        },
        statusOptions: []
      }
    },
    computed: {
      title() {
        return this.disabled ? '查看' : this.formData.id ? '编辑' : '新增'
      }
    },
    watch: {},
    created() {
      // this.getDicts("sys_normal_disable").then(response => {
      //   this.statusOptions = response.data;
      // });
    },
    mounted() {
    },
    methods: {}

  }
</script>
